<template>
	<div id="homenav">
		<el-menu
	      default-active="2"
	      class="el-menu-vertical-demo"
	      @open="handleOpen"
	      @close="handleClose">
	      <el-submenu v-for="(item,key,index) in allMenus" :key="key" :index="String(index)">
	        <template slot="title">
	          <i class="el-icon-location"></i>
	          <span>{{item.permissionDesc}}</span>
	        </template>
	        
	          <el-menu-item v-for="(permission,permissionindex) in item.children"
	          	:key="permissionindex" :index="index+'-'+permissionindex"
	          	@click="pushtoview({name:permission.permissionDesc})">
	          	{{permission.permissionDesc}}
	          </el-menu-item>
	        
	      </el-submenu>
    </el-menu>
	</div>
</template>

<script>
	
	export default{
		methods:{
			handleOpen(){
				
			},
			handleClose(){
				
			}
		},
		computed:{
			allMenus(){
				return this.$store.getters.allMenus;
			}
		},
		mounted(){
			var menus = JSON.parse(localStorage.getItem("response")).permissions;
			this.$store.commit("LOADALLMENUS",menus)
		}
	}
</script>

<style>
</style>